export type NotEqual<X, Y> = true extends Equal<X, Y> ? false : true
export type Equal<X, Y> =
  (<T>() => T extends X ? 1 : 2) extends
  (<T>() => T extends Y ? 1 : 2) ? true : false

export type FirstParma<T extends (...args: any[]) => any> = T extends (a: infer F, ...args: infer P) => infer R ? F : never

export type FN = (...args: any[]) => any

// 复制函数的参数与返回值的类型
export type CopyParamAndReturn<T extends FN> = (...args: Parameters<T>) => ReturnType<T>

export type ChooseRequired<T extends {}, K extends keyof T> = T & {
  [k in K]-?: T[K]
}